package com.sena.utils;

import com.sena.exception.ThreadRunTimeException;
import org.apache.commons.lang3.StringUtils;

/**
 * @author Admin
 */
public class AssertUtils {

    /**
     * 判断是空
     *
     * @param e
     * @param s
     */
    public static void isNull(ThreadRunTimeException e, String s) {
        if (!StringUtils.isBlank(s)) {
            throw e;
        }
    }

    /**
     * 判断非空
     *
     * @param e
     * @param s
     */
    public static void isNotNull(ThreadRunTimeException e, String s) {
        if (StringUtils.isBlank(s)) {
            throw e;
        }
    }

    public static void isNotNull(ThreadRunTimeException e, Object s) {
        if (s == null) {
            throw e;
        }
    }

    public static void isNull(ThreadRunTimeException e, Object o) {
        if (o != null) {
            throw e;
        }
    }

    public static void isTure(ThreadRunTimeException e, boolean b) {
        if (!b) {
            throw e;
        }
    }

    private static void isFalse(ThreadRunTimeException e, boolean b) {
        if (b) {
            throw e;
        }
    }


}
